<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<title>修改多图文消息</title>
	<#include '/frame/version.html'>
	<#include '/frame/manage/include_css.html'>
	
	<#include '/frame/manage/include_js.html'>
	<#include '/frame/taglib.html'>
</head>
<body id="nv_member" class="pg_CURMODULE">
<#assign current='menu_pic'>
	<div id="wp" class="wp">
		<#include "/include/header.html"/>
		<!--中间内容-->
		<div class="contentmanage">
			<div class="developer">
				<div class="tableContent">
					<#include "/include/left.html"/>
					<#include "/include/wxtop.html"/>
					<div class="content">
						<div class="cLineB">
							<h4 style="font-size:16px;">编辑图文自定义内容</h4>
						</div>
						<form method="post" id="form" action="${basePath}/admin/pic/persis" >
							<div class="msgWrap form">
								<table class="userinfoArea" border="0" cellSpacing="0" cellPadding="0" width="100%">
									<thead>
										<tr>
											<th style="width: 120px" valign="top"><span class="red">*</span><label for="keyword">关键词：</label></th>
											<td>
												<input type="text" class="px" id="keyword" value="${bean.pKeyword?default('')}" name="pKeyword" style="width: 580px;" maxlength="200"/>
												<br />多个关键词请用空格格开：例如: 美丽&nbsp;漂亮
											</td>
										</tr>
										<tr style="display:none;">
											<th valign="top"><span class="red">*</span>关键词类型：</th>
											<td>
												<label for="radio2"><input class="radio" id="radio2" type="radio" name="pKeywordType" value="2" checked="checked" /> 包含匹配 （当此关键词包含粉丝输入关键词时有效）</label><br />
												<label for="radio1"><input id="radio1" class="radio" type="radio" name="pKeywordType" value="1" <#if bean.pKeywordType?exists && bean.pKeywordType==1>checked="checked"</#if> /> 完全匹配（当此关键词和粉丝输入关键词完全相同时有效）</label>
											</td>
										</tr>
									</thead>
									<tbody>
										<tr>
											<th><span class="red">*</span><label for="title">标题：</label></th>
											<td><input type="text" class="px" id="title" value="${bean.title?default('')}" name="title" style="width: 580px;" maxlength="20"></td>
										</tr>
										<tr>
											<th valign="top"><span class="red">*</span><label for="text">简介：</label></th>
											<td><textarea class="px" id="Hfcontent" name="pSummary" style="width: 580px; height: 100px" maxlength="200">${bean.pSummary?default('')}</textarea><br />限制200字内
											</td>
										</tr>
										<tr>
											<th valign="top"><span class="red">*</span><label for="pic">封面图片地址：</label></th>
											<td>
												<input type="text" readonly class="px input_width_500" id="input_uploader" value="${bean.pImgHref}" name="pImgHref" />
												<a onclick="uploadImage(this,'picReply',0)" class="a_upload" href="javascript:void(0);">上传</a>
												<a onclick="preViewImage(this)" class="a_upload" href="javascript:void(0);">预览</a>
											</td>
										</tr>
										<tr>
											<th valign="top"><label for="showpic">详细页是否显示封面：</label></th>
											<td>
												&nbsp;&nbsp; 是<input class="radio" type="radio" name="isShow" value="1" checked="checked" /> 
												&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; 
												否<input class="radio" type="radio" name="isShow" value="2" <#if bean.isShow?exists && bean.isShow==2>checked="checked"</#if> />
											</td>
										</tr>
										<tr>
											<th valign="top">
												<label for="info">图文详细页内容：</label>
											</th>
											<td id="td_right_component">
												<script id="container" name="detailContent" type="text/plain">
													${bean.detailContent?default('')}
												</script>
											</td>
										</tr>
										<tr>
											<th valign="top"><label for="url">图文外链网址：</label></th>
											<td>
												<input type="text" class="px" id="input_articleUrl" value="${bean.articleUrl?default('')}" name="articleUrl" maxlength="500" style="width: 580px;">
												<p>
													<span class="red">
														请在输入框填写网址信息(例如：http://www.baidu.com)
													</span>
												</p>
											</td>
										</tr>
										<tr>
											<th></th>
											<td>
												<input type="hidden" name="wxid" value="${wxid?default('')}" />
												<input type="hidden" name="tag" value="${tag?default('add')}" />
												<input type="hidden" name="id" value="${id?default('0')}" />
												<input type="button" value="保存" class="btnGreen left" />
											</td>
										</tr>
									</tbody>
								</table>
							</div>
						</form>
					</div>
					<div class="clr"></div>
				</div>
			</div>
		</div>
		<!--底部-->
	</div>
	</div>
	</div>
	</div>
	<#include "/include/footer.html"/>
	
	<script type="text/javascript" src="${basePath}/js/ue/ueditor.config.js"></script>
    <script type="text/javascript" src="${basePath}/js/ue/ueditor.all.js"></script>
	<script type="text/javascript" src="${basePath}/js/frames/common_uploader.js"></script>
	<script type="text/javascript">
		$(function(){
			$(".btnGreen").on("click",function(){
				var $kw = $("#keyword");
				var keyword = $kw.val();
				var $title=$("#title");
				var title = $title.val();
				var $con=$("#Hfcontent");
				var Hfcontent = $con.val();
				var $pic=$("#input_uploader");
				var input_pic = $pic.val();
				if($.trim(keyword)==""){
					layer.tips('请输入关键词','#keyword');
					$kw.focus();
					return false;
				}else if($.trim(title)==""){
					layer.tips('请输入标题','#title');
					$title.focus();
					return false;
				}else if($.trim(Hfcontent)==""){
					layer.tips('请输入简介','#Hfcontent');
					$con.focus();
					return false;
				}else if($.trim(input_pic)==""){
					layer.tips('封面图片地址','#input_uploader');
					$pic.focus();
					return false;
				}
				$("#form").submit();
			});
		});
	</script>
    <script type="text/javascript">
        var ue = UE.getEditor('container',{
        	 autoHeightEnabled : false,
        	 initialFrameWidth : 600,
        	 initialFrameHeight : 300,
        	 allowDivTransToP: false,
        	 toolbars: [[
                'source', //源代码
                'fontfamily', //字体
                'fontsize', //字号
                'forecolor', //字体颜色
                'bold', //加粗
                'italic', //斜体
                '|',
                'underline', //下划线
                'strikethrough', //删除线
                'fontborder', //字符边框
                'indent', //首行缩进
                'pasteplain', //纯文本粘贴模式
                'selectall', //全选
                'preview', //预览
                'horizontal', //分隔线
                'removeformat', //清除格式
                'inserttitle', //插入标题
                'cleardoc', //清空文档
                '|',
                'simpleupload', //单图上传
                '|',
                'justifyleft', //居左对齐
                'justifyright', //居右对齐
                'justifycenter', //居中对齐
                'justifyjustify', //两端对齐
                '|',
                'paragraph', //段落格式
                'backcolor', //背景色
                '|',
                'fullscreen', //全屏
                'imagenone', //默认
                'imageleft', //左浮动
                'imageright', //右浮动
                'imagecenter', //居中
                '|',
                'lineheight', //行间距
                'autotypeset', //自动排版
                'touppercase', //字母大写
                'tolowercase', //字母小写
                'background',
                '|'
        	]]
        });
        ue.addListener( 'ready', function( editor ) {
		     $(".edui-toolbar")
		     .append('<div style="width:20px;height:20px;position:relative;line-height:20px;display: inline-block;background-repeat:no-repeat;background-position-y:4px;'+
		     	'cursor:pointer;background-image:url(\'${basePath}/images/icons/16/winb.png\')" onclick="openEditor();" title="打开素材库"></div>');
		});
        var layerIndex;
        function openEditor(){
        	console.log(layerIndex);
        	if(0!=layerIndex){
        		return;
        	}
        	var left = 460;
        	var height = ($(window).height()-10);
        	layerIndex=layer.open({
			    type: 2,
			    area: [left+'px', height+'px'],
			    fix: true,
			    shade:false,
			    scrollBar:false,
			    offset: ['10px', '0px'],
			    title: false,
			    content: '${basePath}/anno/leditor'
			});
        }
        function insertIntoUe(content){
        	//ue.setContent(content,true);
        	ue.execCommand('inserthtml', content);
        }
        //
    </script>
</body>
</html>